package com.youngball.business.dao.redis.task;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;

/**
 * Created by liaopingzhu on 2017/1/12.
 */
public class MyMessageListener implements MessageListener{

    @Override
    public void onMessage(Message message, byte[] bytes) {
        System.err.println("channel:" + new String(message.getChannel())
                + ",message:" + new String(message.getBody()));

        //消息推送过来的逻辑代码
//        String msg = new String(message.getBody());
//        String cronName = msg.split(":")[1];
//        System.out.println("cronName=========="+cronName);
//        LightAutoRecord lightAutoRecord = lightAutoRecordMapper.selectByCronName(cronName);
//        if(ObjectNullUtils.isNotBlank(lightAutoRecord)){
//            String handLight = lightAutoRecord.getLightOrder();
//            LightCommand lightCommand = fristSchedulerService.assembledLightCommand(handLight,0);
//            lightCtrlService.handleLight(lightCommand);
//        }
    }
}
